<?php
namespace Home\Controller;
use Think\Controller;
class CommonController extends Controller {

	public function __construct(){//网页初始化
		parent::__construct();
		$this->nav();
        $this->pop();
	}



    public function nav(){
    	//提取cate表的数据，分配在标题栏的位置
    	$cate=D('cate');
    	$navers=$cate->select();
    	$this->assign('navers',$navers);
        //$this->display();
    }



    public function pop(){
        //提取推荐文章
        $article=D('article');
        $where['a_rem']=1;
        $arem=$article->where($where)->select();
        //$arem=$article->where($where)->limit(1)->select();//限制只显示一篇
        $this->assign('arem',$arem); 
        //$this->display();
    }
}